[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
GETSYS.PRG Modifications and corrections. ~
Clipper Version 1.03 dtd 09/15/90.
Problem Statements
1) Unable to enter characters having an ASCII value > 127 in GET's.
2) Control W or Control End exits getlist.
3) Unable to enter negative decimal numbers using decimal point
movement.
4) When a GET ... WHEN <lCond> command is issued and a condition dependent
entry is at the top or bottom of the getlist, the system appears to
lock up.
5) An 'unselected' color setting is ignored until the GET is entered ~
and exited.
Cause
1) Line 413 of an unmodified GETSYS.PRG reads as follows:
if (nKey >= 32 .and. nKey <= 127)
2) GETSYS.PRG option
3) Unknown.
4) GETSYS.PRG programming error.
5) Unknown.
Work Arounds
1) Line 413 may be edited, with caution, to permit a greater range of
entries. Check for conflicts with any SET KEY's or SET FUNCTION's.
GETSYS.PRG should be compiled and linked with your .PRG.
2) The GETSYS.PRG has an #ifdef NOTDEF in the program. If you
#define NOTDEF at the beginning of the file, CTRL W and CTRL END
will move to the last valid item of the getlist.
3) Enter negative decimal numbers, with PICTURE template #, as
spaces up to the position before the decimal point, then minus,
then number OR enter minus, then zeros until cursor jumps past
decimal point, then number.
4) The following changes to GETSYS.PRG will correct the problem.
5) Unknown.
Note: This group of changes should be ignored if the 'Ira' fixes,
below, are incorporated.
********************************************************************
The changes commence at line 242 of the original program.
// 242 if (localReadExit)
i := 0
// 244 else
// 245 i := 0
// 246 direction := BACKWARD
// 247 end
end
else
if ( --i < 1 )
* going backward, at top of getlist
if (localReadExit)
i := 0
else
i := 2 // changed 255, was i := 1
********************************************************************
GETSYS.PRG should be compiled with the /N option and linked with
your .PRG.
Note: The following changes to GETSYS.PRG have been submitted by
Ira Emus (76702,672) to 'fix a bunch of anomalies you might find when
using the WHEN keyword.' :
********************************************************************
186 LOCAL nKey := 0, cKey // change
242 IF (LocalReadExit) .OR. nKey == K_ENTER // change
246 i := nLen-1 // change
256 i := 2 // change
334 new := if( localReadExit, 0, 1 ) // reference
335 GetExitRequested := new == 0 // Add
341 new := if( localReadExit, 0, nLen ) // reference
348 GetExitRequested := new == 0 // Add
183 local g, passcount := 0 // change
246 direction := BACKWARD // reference
247 passcount++ // add
256 direction := FORWARD // reference
257 passcount++ // add
260 IF passcount = 2 // add
261 i := 0 // add
262 ENDIF // add
263 loop // reference
264 end // reference
265 passcount := 0 // add
260 g:display() // Add
261 loop // reference
********************************************************************
The above 'Ira' changes have been 're-ordered' by another user
as follows:
"The changes are reordered so that the added lines are in reverse
order so that line numbers don't change their reference line number.
183->182 means 'Ira' code showed line 183 but it should have been 182.
Changed Lines:
183->182 local g, passcount := 0 // change
186->185 LOCAL nKey := 0, cKey // change
242 IF (LocalReadExit) .OR. nKey == K_ENTER // change
246->245 i := nLen-1 // change
256->255 i := 2 // change
Added Lines:
341->334 new := if( localReadExit, 0, nLen ) // reference
348->335 GetExitRequested := new == 0 // Add
334->327 new := if( localReadExit, 0, 1 ) // reference
335->328 GetExitRequested := new == 0 // Add
These 7 line numbers are difficult to tell exactly where g:display()
goes since two changes were made here. They've been combined.
Original code reference:
263->260 loop // reference
264->261 end // reference
After additions (with new line numbers for loop and end).
260 IF passcount = 2 // add
261 i := 0 // add
262 ENDIF // add
260->263 g:display() // add
263->264 loop // reference
264->265 end // reference
265->266 passcount := 0 // add
These four lines are correct.
256 direction := FORWARD // reference
257 passcount++ // add
246 direction := BACKWARD // reference
247 passcount++ // add "
Note
Author's note: I think the 'differences' may be due to Version 1.02 vs.
1.03 - hope everyone can decipher 'em. Thanks to Ira!
See Also:
\SOURCE\SYS
READ
PICTURE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson